#ifndef LINK_H
#define LINK_H

#include <QGraphicsLineItem>
#include "node.h"
#include "device.h"

class Device;
class Node;


class Link : public QGraphicsLineItem
{
public:
    Link(Node *fromNode, Node *toNode);
    Link(Device *fromNode, Device *toNode);
    ~Link();

    Node *fromNode() const;
    Node *toNode() const;

    Device *fromDevice() const;
    Device *toDevice() const;

    void setColor(const QColor &color);
    QColor color() const;

    void trackNodes();
    void trackDevs();

private:
    Node *myFromNode;
    Node *myToNode;
    Device *myFromDevice;
    Device *myToDevice;
};

#endif
